/*
 *  CSE 40166, Computer Graphics, Fall 2013
 *
 *  PORT
 *  File: vehicle.cpp
 *
 *  Kevin Sonnen
 *
 *  Description: Abstract class representing a vehicle. Includes functionality
 *  for changing position/velocity mainly
 *
 */

#include <iostream>
 
#include "vehicle.h"
#include "drawShapes.h"

void vehicle::setPosition(const std::vector<float> &newPos) {
	position[0] = newPos[0];
	position[1] = newPos[1];
}

std::vector<float> vehicle::getPosition() {
	return position;
}

void vehicle::moveForward() {
	velocity[1] = vehicleSpeed;
}

void vehicle::moveBackward() {
	velocity[1] = -vehicleSpeed;
}

void vehicle::moveLeft() {
	velocity[0] = -vehicleSpeed;
}

void vehicle::moveRight() {
	velocity[0] = vehicleSpeed;
}

void vehicle::stopVertical() {
	velocity[1] = 0;
}

void vehicle::stopHorizontal() {
	velocity[0] = 0;
}

void vehicle::setVelocity(const std::vector<float> &newVel) {
	velocity[0] = newVel[0];
	velocity[1] = newVel[1];
}

std::vector<float> vehicle::getVelocity() {
	return velocity;
}

void vehicle::setRotation(const float &newRotation) {
	rotationAngle = newRotation;
}

/*float vehicle::getRotationVelocity() {
	return rotationVelocity;
}

void vehicle::rotateLeft() {
	rotationVelocity = -rotationSpeed;
}

void vehicle::rotateRight() {
	rotationVelocity = rotationSpeed;
}

void vehicle::stopRotation() {
	rotationVelocity = 0;
}

float vehicle::getRotation() {
	return rotationAngle;
}*/
